using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Daniel.Core.Models.Mapping
{
    public class TBatchMap : EntityTypeConfiguration<TBatch>
    {
        public TBatchMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.BATCHID)
                .HasMaxLength(50);

            this.Property(t => t.BATCHCREATOR)
                .HasMaxLength(200);

            this.Property(t => t.BATCHACTIVEFILE)
                .HasMaxLength(400);

            // Table & Column Mappings
            this.ToTable("TBatch");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.BATCHID).HasColumnName("BATCHID");
            this.Property(t => t.BATCHCREATOR).HasColumnName("BATCHCREATOR");
            this.Property(t => t.BATCHSTARTTIME).HasColumnName("BATCHSTARTTIME");
            this.Property(t => t.BATCHFILECOUNT).HasColumnName("BATCHFILECOUNT");
            this.Property(t => t.BATCHPERCENTCOMPLETE).HasColumnName("BATCHPERCENTCOMPLETE");
            this.Property(t => t.BATCHACTIVEFILE).HasColumnName("BATCHACTIVEFILE");
            this.Property(t => t.BATCHCURRENTTASKID).HasColumnName("BATCHCURRENTTASKID");
        }
    }
}
